package cn.wang.service;

import cn.wang.dao.UserDao;
import cn.wang.dao.UserDaoImpl;
import cn.wang.factory.UserDaoFactory;
import cn.wang.pojo.User;

public class UserServiceImpl implements UserService{
//    private UserDao dao = new UserDaoImpl();
    private  UserDao dao = UserDaoFactory.getInstance();
    @Override
    public void save(User user) {
        dao.save(user);
    }

    private UserDao userDao;
    public void save2(User user){
        userDao.saveUser(user);
    }
    public void setUserDao(UserDao userDao){
        this.userDao=userDao;
    }
}
